{% extends 'car_system/base.html' %}

{% block title %}登录 - 汽车数据分析系统{% endblock %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header bg-primary text-white text-center">
                <h4><i class="fas fa-sign-in-alt me-2"></i>用户登录</h4>
            </div>
            <div class="card-body">
                <form method="POST">
                    {% csrf_token %}
                    <div class="mb-3">
                        <label for="{{ form.username.id_for_label }}" class="form-label">用户名</label>
                        {{ form.username }}
                        {% if form.username.errors %}
                            <div class="text-danger">
                                {% for error in form.username.errors %}
                                    {{ error }}
                                {% endfor %}
                            </div>
                        {% endif %}
                    </div>
                    <div class="mb-3">
                        <label for="{{ form.password.id_for_label }}" class="form-label">密码</label>
                        {{ form.password }}
                        {% if form.password.errors %}
                            <div class="text-danger">
                                {% for error in form.password.errors %}
                                    {{ error }}
                                {% endfor %}
                            </div>
                        {% endif %}
                    </div>
                    <div class="mb-3">
                        <a href="{% url 'password_reset' %}" class="text-decoration-none">忘记密码？</a>
                    </div>
                    <div class="d-grid gap-2">
                        <button type="submit" class="btn btn-primary btn-lg">登录</button>
                    </div>
                </form>
            </div>
            <div class="card-footer text-center">
                <p class="mb-0">还没有账号？ <a href="{% url 'register' %}" class="text-decoration-none">立即注册</a></p>
            </div>
        </div>
    </div>
</div>
{% endblock %} 